package main

import "fmt"

var g int

func main() {

	var a, b, c int
	a = 1
	b = 2
	c = a + b

	fmt.Printf("结果： a = %d, b = %d and c = %d\n", a, b, c)

	g = a + b
	fmt.Printf("结果： a = %d, b = %d and g = %d\n", a, b, g)

	var g int = 10

	fmt.Printf("结果： g = %d\n", g)

	fmt.Printf("main()函数中 a = %d\n", a)
	c = sum(a, b)
	fmt.Printf("main()函数中 c = %d\n", c)
}

func sum(a, b int) int {
	fmt.Printf("sum() 函数中 a = %d\n", a)
	fmt.Printf("sum() 函数中 b = %d\n", b)

	return a + b
}
